package com.love.cloud.common.mybatis.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

/**
 * Description:
 * Author: Yewm
 * Date:2021-03-22 9:43
 */
@Data
@Entity
@Table(name = "tb_files",indexes = {@Index(columnList = "relation_id"),@Index(columnList = "relation_type")})
@TableName("tb_files")
@EqualsAndHashCode(callSuper = false)
@org.hibernate.annotations.Table(appliesTo = "tb_files",comment="文件信息")
public class FileBean extends BaseEntity {

    /**
     * @Fields path : 地址
     */
    @TableField
    @Column( columnDefinition = "VARCHAR(500) COMMENT '文件后缀路径'")
    private String filePath;


    /**
     * @Fields fileName : 文件名
     */
    @TableField
    @Column( columnDefinition = "VARCHAR(255) COMMENT '文件名'")
    private String fileName;

    /**
     * @Fields relationId :关联表id
     */
    @TableField
    @Column(name = "relation_id", columnDefinition = "bigint(20) COMMENT '关联表id'")
    private Long relationId;
    /**
     * @Fields relationType :文件关联类型
     */
    @TableField
    @Column(name = "relation_type", columnDefinition = "varchar(80) COMMENT '文件关联类型'")
    private String relationType;

    /**
     * 上传文件/合并文件的格式
     */
    @Column(columnDefinition = "varchar(32) COMMENT '上传文件/合并文件的格式'")
    private String suffix;

    /**
     * 源文件存储桶名称
     */
    @Column(columnDefinition = "varchar(80) COMMENT '源文件存储桶名称'")
    private String fileBucketName;

    /**
     * @Fields status : 文件状态
     */
    @TableField(exist = false)
    private String status = "done";


    /**
     * @Fields status : 文件状态
     */
    @TableField(exist = false)
    @Transient
    private String poiShowName = "";


    /**
     * OSS打包下载用字段
     */
    @TableField(exist = false)
    @Transient
    private String localFilePath = "";

}
